<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('对象详情')" />
</head>
<body class="white-bg" onload="load();">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-object-edit" th:object="${objectName}">
            <input name="objectId" th:field="*{objectId}" type="hidden">

            <!--<div class="form-group">    -->
                <!--<label class="col-sm-3 control-label">父对象选择：</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<div class="input-group">-->
                        <!--<input id="treeId" name="parentId" type="hidden" th:field="*{parentId}" />-->
                        <!--<input class="form-control" type="text" onclick="selectObjectTree()" id="treeName" readonly="true" th:field="*{parentName}">-->
                        <!--<span class="input-group-addon"><i class="fa fa-search"></i></span>-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="form-group">    -->
                <!--<label class="col-sm-3 control-label">对象名称：</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<input name="objectName" th:field="*{objectName}" class="form-control" type="text">-->
                <!--</div>-->
            <!--</div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-2 control-label">二级对象类型：   </label>-->
<!--                <div id="bType" class="form-control-static" th:text="${objectName.bType}">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-2 control-label">对象名称：   </label>-->
<!--                <div class="form-control-static" th:text="${objectName.objectName}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j2" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">IP地址：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.ipAddress}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j3" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">域名：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.domainName}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j1" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">优先级：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.priority}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j4" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">端口：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.ipPort}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j5" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">服务：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.service}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j6" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">访问方式：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.uri}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j7" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">账号口令：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.accountPass}">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" id="j8" style="display:none;">-->
<!--                <label class="col-sm-2 control-label">版本信息：</label>-->
<!--                <div class="form-control-static" th:text="${objectName.version}">-->
<!--                </div>-->
<!--            </div>-->




            <div class="form-group" th:each="obj : ${object}">
                <div class="form-group">
                    <label class="col-sm-2 control-label">二级对象类型：   </label>
                    <div id="2j" class="form-control-static" th:text="${obj.bType}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">一级对象类型：   </label>
                    <div id="j" class="form-control-static" th:text="${obj.aType}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">对象名称：   </label>
                    <div class="form-control-static" th:text="${obj.objectName}">
                    </div>
                </div>
                <div class="form-group" id="j1" style="display:none;">
                    <label class="col-sm-2 control-label">优先级：</label>
                    <div class="form-control-static" th:text="${obj.priority}">
                    </div>
                </div>
                <div class="form-group" id="j2" style="display:none;">
                    <label class="col-sm-2 control-label">IP地址：</label>
                    <div class="form-control-static" th:text="${obj.ipAddress}">
                    </div>
                </div>
                <div class="form-group" id="j3" style="display:none;">
                    <label class="col-sm-2 control-label">域名：</label>
                    <div class="form-control-static" th:text="${obj.domainName}">
                    </div>
                </div>
                <div class="form-group" id="j4" style="display:none;">
                    <label class="col-sm-2 control-label">端口：</label>
                    <div class="form-control-static" th:text="${obj.ipPort}">
                    </div>
                </div>
                <div class="form-group" id="j5" style="display:none;">
                    <label class="col-sm-2 control-label">服务：</label>
                    <div class="form-control-static" th:text="${obj.service}">
                    </div>
                </div>
                <div class="form-group" id="j6" style="display:none;">
                    <label class="col-sm-2 control-label">访问方式：</label>
                    <div class="form-control-static" th:text="${obj.uri}">
                    </div>
                </div>
                <div class="form-group" id="j7" style="display:none;">
                    <label class="col-sm-2 control-label">账号口令：</label>
                    <div class="form-control-static" th:text="${obj.accountPass}">
                    </div>
                </div>
                <div class="form-group" id="j8" style="display:none;">
                    <label class="col-sm-2 control-label">版本信息：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

<!--                还未实现逻辑-->
                <div class="form-group" id="j9" style="display:none;">
                    <label class="col-sm-2 control-label">有无登录点：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j10" style="display:none;">
                    <label class="col-sm-2 control-label">登录方式：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j11" style="display:none;">
                    <label class="col-sm-2 control-label">控制台类型：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j12" style="display:none;">
                    <label class="col-sm-2 control-label">下载地址：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j13" style="display:none;">
                    <label class="col-sm-2 control-label">风险等级：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j14" style="display:none;">
                    <label class="col-sm-2 control-label">验证情况：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j15" style="display:none;">
                    <label class="col-sm-2 control-label">漏洞类型：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j16" style="display:none;">
                    <label class="col-sm-2 control-label">CVE编号：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j17" style="display:none;">
                    <label class="col-sm-2 control-label">WEB漏洞类型：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j18" style="display:none;">
                    <label class="col-sm-2 control-label">漏洞位置：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j19" style="display:none;">
                    <label class="col-sm-2 control-label">请求链接：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j20" style="display:none;">
                    <label class="col-sm-2 control-label">关键参数：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j21" style="display:none;">
                    <label class="col-sm-2 control-label">请求信息：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j22" style="display:none;">
                    <label class="col-sm-2 control-label">响应信息：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j23" style="display:none;">
                    <label class="col-sm-2 control-label">后渗透对象访问方式：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j24" style="display:none;">
                    <label class="col-sm-2 control-label">敏感度：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group" id="j25" style="display:none;">
                    <label class="col-sm-2 control-label">数据规模：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>

                <div class="form-group"  style="display:none;">
                    <label class="col-sm-2 control-label">备注：</label>
                    <div class="form-control-static" th:text="${obj.version}">
                    </div>
                </div>




            </div>

<!--            <div th:each="obj : ${object}" th:text="${obj.objectName}"></div>-->
<!--            <div th:each="obj : ${object}" th:text="${obj.ipAddress}"></div>-->





        </form>

    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/object";
        $("#form-object-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-object-edit').serialize());
            }
        }

        /*过程-新增-选择父部门树*/
        function selectObjectTree() {
            var options = {
                title: '过程选择',
                width: "380",
                url: prefix + "/selectObjectTree/" + $("#treeId").val(),
                callBack: doSubmit
            };
            $.modal.openOptions(options);
        }

        function doSubmit(index, layero){
            var body = layer.getChildFrame('body', index);
               $("#treeId").val(body.find('#treeId').val());
               $("#treeName").val(body.find('#treeName').val());
               layer.close(index);
        }
        function myfun() 　　{
            var checkText2 = $("#j").text();
            // alert(checkText2);

            if(checkText2 == '组织对象'){
                document.getElementById('j1').style.display="block";

            }
            if(checkText2 == 'IP地址'){
                document.getElementById('j2').style.display="block";
                document.getElementById('j3').style.display="block";

            }

            if(checkText2 == '服务' || checkText2 == 'VPN'){
                document.getElementById('j1').style.display="block";
                document.getElementById('j4').style.display="block";
                document.getElementById('j5').style.display="block";
                document.getElementById('j6').style.display="block";
                document.getElementById('j7').style.display="block";
                document.getElementById('j8').style.display="block";
            }
            if(checkText2 == '网站'){
                document.getElementById('j1').style.display="block";
                document.getElementById('j4').style.display="block";
                document.getElementById('j5').style.display="block";
                document.getElementById('j6').style.display="block";
                document.getElementById('j7').style.display="block";
                document.getElementById('j8').style.display="block";
                document.getElementById('j9').style.display="block";
                document.getElementById('j10').style.display="block";
            }
            if(checkText2 == '控制台'){
                document.getElementById('j1').style.display="block";
                document.getElementById('j4').style.display="block";
                document.getElementById('j5').style.display="block";
                document.getElementById('j6').style.display="block";
                document.getElementById('j7').style.display="block";
                document.getElementById('j8').style.display="block";
                document.getElementById('j11').style.display="block";
            }
            if(checkText2 == 'APP'){
                document.getElementById('j1').style.display="block";
                document.getElementById('j4').style.display="block";
                document.getElementById('j5').style.display="block";
                document.getElementById('j6').style.display="block";
                document.getElementById('j7').style.display="block";
                document.getElementById('j8').style.display="block";
                document.getElementById('j12').style.display="block";
            }

            if(checkText2 == '客户端漏洞'){
                document.getElementById('j13').style.display="block";
                document.getElementById('j14').style.display="block";
                document.getElementById('j15').style.display="block";
            }
            if(checkText2 == '系统漏洞'){
                document.getElementById('j13').style.display="block";
                document.getElementById('j14').style.display="block";
                document.getElementById('j16').style.display="block";
                document.getElementById('j6').style.display="block";

            }
            if(checkText2 == 'WEB应用漏洞'){
                document.getElementById('j13').style.display="block";
                document.getElementById('j14').style.display="block";
                document.getElementById('j17').style.display="block";
                document.getElementById('j18').style.display="block";
                document.getElementById('j19').style.display="block";
                document.getElementById('j20').style.display="block";
                document.getElementById('j21').style.display="block";
                document.getElementById('j22').style.display="block";
            }
            if(checkText2 == 'webshell' || checkText2 == '命令行' || checkText2 == '桌面'){
                document.getElementById('j7').style.display="block";
                document.getElementById('j23').style.display="block";

            }
            if(checkText2 == '无'){
                document.getElementById('j24').style.display="block";
                document.getElementById('j25').style.display="block";

            }
            // alert(btype);
        }
        window.onload = myfun;
        // window.onload=function (){
        //     /*代码区域*/
        //     alert("this window.onload");
        // }
    </script>
</body>
</html>